//
//  TwoLabelCollectionCell.m
//  QuXiang
//
//  Created by Duncan on 2020/8/10.
//  Copyright © 2020 NanHuaiZi. All rights reserved.
//

#import "TwoLabelCollectionCell.h"

@implementation TwoLabelCollectionCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self.contentView addSubviews:[NSArray arrayWithObjects:self.topLabel, self.bottomLabel, nil]];
        [self masonryLayout];
    }
    return self;
}

#pragma mark ------- Lazy Methods -------

- (void)masonryLayout {
    [self.topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.contentView.mas_top).offset(kFragmemtFloat(10));
    }];
    [self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.topLabel.mas_bottom).offset(kFragmemtFloat(10));
    }];
}

- (UILabel *)topLabel {
    if (!_topLabel) {
        _topLabel = [UILabel initWithTextColor:k_Color_333333 boldFontSize:16];
    }
    return _topLabel;
}

- (UILabel *)bottomLabel {
    if (!_bottomLabel) {
        _bottomLabel = [UILabel initWithTextColor:k_Color_TipColor fontSize:12];
    }
    return _bottomLabel;
}

@end
